<%@ Page EnableEventValidation="false" EnableViewState="false" Language="vb" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="pages_Seriess_default" 
  MasterPageFile="~/pages/default.master"
  Title="Time Series"
%>

<%@ Register src="usercontrols/UCSeriess.ascx" tagname="UCSeriess" tagprefix="uc" %>
<asp:Content ID=h ContentPlaceHolderID=head runat=server>
    <style>
        legend { font-weight:bold; }
        fieldset { display:block; }
    </style>
    
    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
    <script type="text/javascript"> 
      google.load("visualization", "1", {packages:["linechart"]}); 
      google.setOnLoadCallback(drawChart); 
      function drawChart() { 
var data = new google.visualization.DataTable(); 
data.addColumn('string', 'Date'); 
data.addColumn('number', 'Total');
<asp:Literal ID=litScript runat=server />
 
        var chart = new google.visualization.LineChart(document.getElementById('chart_div')); 
        chart.draw(data, {width: 1100, height: 360, legend: 'right'}); 
      }       
    </script>     
</asp:Content>
<asp:Content ID="c" ContentPlaceHolderID="body" runat="server">


    <uc:UCSeriess ID="ctrlSeriess" runat="server" />
        <thead>
            <tr>
                <th style=text-align:right colspan=2>Summary:</th>
                <th style=text-align:right;color:yellow><asp:Literal ID=litSimTime runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litFrom runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litTo runat=server /></th>
                <th style=text-align:right colspan=3><asp:Literal ID=litLeverage runat=server /> * <font color=yellow><asp:Literal ID=litActiveSeries runat=server /></font> * <font color=yellow><asp:Literal ID=litStart runat=server /></font> </th>
                <th style=text-align:right><asp:Literal ID=litHigh runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litLow runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litFinish runat=server /></th>
                <th style=text-align:right;color:yellow><asp:Literal ID=litProfit runat=server /></th>
                <th style=text-align:right;color:yellow><asp:Literal ID=litReturns runat=server /></th>
                <th style=text-align:right;color:yellow><asp:Literal ID=litAnnRet runat=server  /></th>
                <th style=text-align:right><asp:Literal ID=litAvgExposure runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litMaxExposure runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litExpAdjRet runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litWins runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litLosses runat=server /></th>
                <th style=text-align:right><asp:Literal ID=litFlat runat=server /></th>
                <th></th>
            </tr>
        </thead>
        
    </table>


    <table><tr><td valign=top>
        
    
    <fieldset>
        <legend>Tuning Parameters</legend>
        <table style="white-space:nowrap">
            <tr title="Ignore all data before this date (leave blank for no limit)">
                <td>From Date:</td>
                <td>
                    <asp:TextBox ID=txtFrom runat=server Width=80px />
                    <asp:Button ID=btnGo1 runat=server Text=Go />
                </td>
            </tr>
            <tr title="Ignore all data before this date (leave blank for no limit)">
                <td>To Date:</td>
                <td>
                    <asp:TextBox ID=txtTo runat=server Width=80px />
                    <asp:Button ID=btnGo2 runat=server Text=Go />
                </td>
            </tr>
            <tr  title="Initial amount to invest in each Series">
                <td>Starting Pool</td>
                <td>
                    <asp:TextBox ID=txtStart runat=server Width=80px  />
                    <asp:Button ID=btnGo8 runat=server Text="Go" />
                </td>
            </tr>
            <tr title="Window Length for calcs involving Exponential Moving Averages">
                <td>Period (ADX/DM/TR):</td>
                <td>
                    <asp:DropDownList ID=ddPeriodADX runat=server AutoPostBack=true />
                    <asp:DropDownList ID=ddPeriodDM runat=server AutoPostBack=true />
                    <asp:DropDownList ID=ddPeriodTR runat=server AutoPostBack=true />
                </td>
            </tr>
            <tr title="ADX ranges from 0 to 100, where 20=weak trend and 40=strong trend.">
                <td>Min ADX:</td>
                <td valign=top>
                    <asp:TextBox ID=txtMinAdx runat=server Width=80px />
                    <asp:Button ID=btnGo6 runat=server Text=Go />
                </td>
            </tr>
            <tr title="As well as a have a rising ADX, can also require a minimum increase e.g. 1">
                <td>Min ADX Change:</td>
                <td>
                    <asp:TextBox ID=txtMinAdxChange runat=server Width=80px />
                    <asp:Button ID=btnGo5 runat=server Text=Go />
                </td>
            </tr>
            <tr title="Toleranace for losing positions, as a multiple of the ATR. 0, 1.5 & 2 are common values">
                <td>Stop Ratio:</td>
                <td valign=top>
                    <asp:TextBox ID=txtStopRatio runat=server Width=80px />
                    <asp:Button ID=btnGo3 runat=server Text=Go />
                </td>
            </tr>
            <tr title="Proportion of held money to invest (default is 2%)">
                <td>Invest Ratio:</td>
                <td valign=top>
                    <asp:TextBox ID=txtInvestRatio runat=server Width=80px />
                    <asp:Button ID=btnGo4 runat=server Text=Go />
                </td>
            </tr>
            <tr title="Magnifies the ratio above, using credit facility provided by the system">
                <td>Leverage:</td>
                <td valign=top>
                    <asp:TextBox ID=txtLeverage runat=server Width=80px />
                    <asp:Button ID=btnGo7 runat=server Text=Go />
                </td>
            </tr>
            <tr>
                <td colspan=2 valign=top>
                    <asp:CheckBox ID=chkAdxInvestMore ToolTip="Multiply the investment ratio above according to ADX:
x0.5  (0-20)
x1   (20-30)
x1.5 (30-40)
x2   (40-50)
x2.5 (50-60)
x3   (60+)"  runat="server" Text="Invest more if ADX is higher" AutoPostBack=true /><br />
                    <asp:CheckBox id=chkInvestRepeatedly    runat=server Text="Repeatedly invest while long/short" AutoPostBack=true /><br />
                    <asp:CheckBox ID=chkStopWhenSeedGone    runat=server Text="Stop when seed capital has been lost" AutoPostBack=true /><br />
                    <asp:CheckBox ID=chkCancelOpenTrades    runat=server Text="Cancel OpenPrice trades if price is beyond StopPrice" AutoPostBack=true />
                </td>
            </tr>
        </table>
    </fieldset>

    </td>
    <td valign=top style=padding-left:20px>

        <strong style="margin-left:80px">Profit Curves <asp:Literal ID=litFreq runat=server /></strong>
        <div id="chart_div"></div> 

    </td></tr></table>


    
</asp:Content>
